import request from '@/utils/request';

let mouldName = 'project';
export default {
  batchAdd(data) {
    return request({
      url: `/${mouldName}/batchadd`,
      method: 'post',
      data
    });
  },
  checkExist(params) {
    return request({
      url: `/${mouldName}/existence`,
      method: 'get',
      params
    });
  },
  query(params) {
    return request({
      url: `/${mouldName}`,
      method: 'get',
      params
    });
  },
  get(id) {
    return request({
      url: `/${mouldName}/${id}`,
      method: 'get'
    });
  },
  update(projectId, data) {
    return request({
      url: `/${mouldName}/${projectId}`,
      method: 'put',
      data
    });
  },
  add(data) {
    return request({
      url: `/${mouldName}`,
      method: 'post',
      data
    });
  },
  delete(id) {
    return request({
      url: `/${mouldName}/${id}`,
      method: 'delete'
    });
  }
};

